<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-05-05 22:02:56
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-09-29 16:21:00
-->
<template>
  <div id="R2" style="height: 95%"></div>
</template>
<script>
import { Bullet } from '@antv/g2plot';

export default {
  data(){
    return{
      R2_data:[
  {
    title: '满意度',
    ranges: [100],
    measures: [80],
    target: 85,
  },
  {
    title: '不满意度',
    ranges: [100],
    measures: [20],
    target: 85,
  },
]
    }
  },
  methods: {
    getdata(){
      const bulletPlot = new Bullet('R2', {
  data: this.R2_data,
  measureField: 'measures',
  rangeField: 'ranges',
  targetField: 'target',
  xField: 'title',
  color: {
    range: '#f0efff',
  },
  yAxis: false,
});

bulletPlot.render();
    }
  },
  mounted(){
    this.getdata();
  }
}
</script>